# with:会自动关闭文件
with open("D:\\soft\\code\\data\\words.txt", mode="r", encoding="UTF-8") as file:
    # 读取所有行
    lines = file.readlines()

    # 去掉后面的换行符
    lines = [line.rstrip() for line in lines]


print(lines)